package com.zmn.oms.persistence.interfaces.callrecord;

import com.zmn.oms.model.entity.callrecord.OrderCallRecord;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface OrderCallRecordDao {

    /**
     * 通过主键查询通话记录
     * @param callRecordId
     * @return
     */
    OrderCallRecord findOrderRecordByKey(Long callRecordId);

    /**
     * 查询首次通话开始时间
     *
     * @param orderId 订单id
     * @return {@link Date}
     */
    Date findFirstStartTime(Long orderId);

    /**
     * 通过orderId查询通话记录
     * @param orderId
     * @return
     */
    List<OrderCallRecord> listOrderCallRecordByOrderId(Long orderId);

    /**
     * 保存通话记录
     * @param orderCallRecord
     * @return
     */
    void insertOrderCallRecord(OrderCallRecord orderCallRecord);

    /**
     * 批量插入通话记录
     * @param orderCallRecordList
     * @return
     */
    void insertOrderCallRecordList(@Param("orderCallRecordList") List<OrderCallRecord> orderCallRecordList);

}